;;;;;;;;;;;;; it's from https://book.emacs-china.org/#orgdb14f27
(provide 'init)

(setq package-archives '(("gnu"   . "http://mirrors.cloud.tencent.com/elpa/gnu/")
                         ("melpa" . "http://mirrors.cloud.tencent.com/elpa/melpa/")))
(package-initialize) ;; You might already have this line
;; not call package-refresh-contents again and again, it will affect performance
(when (not package-archive-contents)
  (package-refresh-contents))

(global-display-line-numbers-mode t)
(if (string-equal user-login-name "z004c7jn")
    (setq default-directory "C:/projects/cl"))

(setq make-backup-files nil)

(tool-bar-mode nil)

(set-face-attribute 'default nil :height 160);;font size
;; make scroll moothly
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)))
(setq mouse-wheel-progressive-speed nil)

;; display my key and commands on modeline
(package-install 'keycast)
(keycast-mode t)

;; enhance autocomplete in minibuffer
(package-install 'vertico) ;commands in minibuffer display vertically.
(vertico-mode t)

(package-install 'orderless) ;commands match orderlessly
(setq completion-styles '(orderless))

;; enhance annotation in minibuffer using Marginalia
(package-install 'marginalia)
(marginalia-mode t)

;; minibuffer action and context menu
(package-install 'embark)
(global-set-key (kbd "C-;") 'embark-act)
(setq prefix-help-command 'embark-prefix-help-command)

;; enhance search in file and auto-jump to function
(package-install 'consult)
(global-set-key (kbd "C-s") 'consult-line)

